﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SSPivot.AspNetCore.Abstractions
{
    /// <summary>
    /// DisposeAction
    /// </summary>
    public class DisposeAction : IDisposable
    {
        private readonly Action _action;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="action"></param>
        public DisposeAction(Action action)
        {
            _action = action;
        }

        /// <summary>
        /// 释放操作
        /// </summary>
        public void Dispose()
        {
            _action();
        }
    }
}
